#include <stdio.h>
#define END_OF_CYCLE 1

int step(int start){
	if(start == 1){
		return 1;
	}
	else if(start%2 == 0){
		return start/2;
	}
	else{
		return ((3*start)+1);
	}
}

int findCycleNumber(int input){
	int steps = 1;

	while(input != END_OF_CYCLE){
		steps++;
		input = step(input);
	} 

	return steps;
}

int maxCycles(int i, int j){
	if(i == j){
		return findCycleNumber(i);
	}
	else{
		int low = (i<j)?i:j;
		int high = (i<j)?j:i;
		int max = 0;
		int c;
		for(c = low; c <= high; c++){
			int tmp = findCycleNumber(c);
			if(tmp>max){
				max = tmp;	
			}
		}
		return max; 
	}
}

int main(){
	int i, j;
	while(scanf("%d %d",&i,&j)==2){
		printf("%d %d %d\n", i, j, maxCycles(i,j));
	}
	return(0);
}

